# -*- coding: UTF-8 -*- 
from django import forms
from models import *
from django.utils.safestring import mark_safe



class patientForm(forms.ModelForm):
	
    class Meta:
        model = patient	
        # exclude = [] # uncomment this line and specify any field to exclude it from the form

    def __init__(self, *args, **kwargs):
        super(patientForm, self).__init__(*args, **kwargs)



class PatientNoForm(forms.ModelForm):
	
    class Meta:
        model = PatientNo	
        # exclude = [] # uncomment this line and specify any field to exclude it from the form

    def __init__(self, *args, **kwargs):
        super(PatientNoForm, self).__init__(*args, **kwargs)



class hospitalizedForm(forms.ModelForm):
	
    class Meta:
        model = hospitalized	
        # exclude = [] # uncomment this line and specify any field to exclude it from the form

    def __init__(self, *args, **kwargs):
        super(hospitalizedForm, self).__init__(*args, **kwargs)
        

class newpatientForm(forms.Form):
    patient_name=forms.CharField(max_length=50)
    patient_age=forms.CharField ()
    patient_birthdate=forms.DateField()
    patient_company=forms.CharField(max_length=100,required=False)
    patient_home=forms.CharField(max_length=100,required=False)
    patient_tel=forms.CharField(max_length=13,required=False)
    patient_card=forms.CharField (required=False)
    patient_native=forms.CharField(max_length=20,required=False)
    patient_inputdate=forms.DateField()
    patient_number=forms.CharField()
    patient_remark=forms.CharField(max_length=200,required=False)
    patient_gender=forms.CharField(max_length=4)
    Patient_no=forms.CharField()
    hospitalized_no=forms.CharField()
    nno = forms.CharField()
    nho = forms.CharField()
    patient_id = forms.CharField(required=False)
'''
    def clean_patient_number(self):
          
        number = self.cleaned_data['patient_number']
        thispatient = patient.objects.filter(patient_number = number)

        
        if thispatient.count() > 0:
            raise forms.ValidationError(mark_safe("此登记号已被使用，<a href='#'onclick='history.go(-1)'>请使用新登记号。</a>")) 
        return number
'''

class IncentiveForm(forms.Form):
    Infection = forms.CharField(max_length=300,required=False)
    Pregnancy = forms.CharField(max_length=300,required=False)
    Drugs =  forms.CharField(max_length=300,required=False)
    Tired = forms.CharField(max_length=300,required=False)
    Psychogenic = forms.CharField(max_length=300,required=False)
    Fitment = forms.CharField(max_length=300,required=False)
    Menopause = forms.CharField(max_length=300,required=False)
    Others = forms.CharField(max_length=300,required=False)
    
    
class ManifestationForm(forms.Form):
	Initial = forms.CharField(max_length=600,required=False)
	Skin = forms.CharField(max_length=600,required=False)
	Joint = forms.CharField(max_length=600,required=False)
	Muscle = forms.CharField(max_length=600,required=False)
	Respiratory = forms.CharField(max_length=600,required=False)
	Cardiovascular = forms.CharField(max_length=600,required=False)
	Raynaud = forms.CharField(max_length=600,required=False)
	Digestive = forms.CharField(max_length=600,required=False)
	Hemotologic = forms.CharField(max_length=600,required=False)
	Urinary = forms.CharField(max_length=600,required=False)
	Nervous = forms.CharField(max_length=600,required=False)
	Menstruation = forms.CharField(max_length=600,required=False)
    
    
class CourseForm(forms.Form):
	Course = forms.CharField(max_length=3000,required=False)
    
    
class HistoryForm(forms.Form):
	Past = forms.CharField(max_length=3000,required=False)
	Family = forms.CharField(max_length=3000,required=False)
	Birth = forms.CharField(max_length=3000,required=False)
	Pregnancy = forms.CharField(max_length=3000,required=False)
	Birthtime = forms.CharField(max_length=30,required=False)
	Abortion = forms.CharField(max_length=30,required=False)
	Living = forms.CharField(max_length=30,required=False)
   	Fs = forms.CharField(max_length=30,required=False)
   	Ms = forms.CharField(max_length=30,required=False)
   	
   	
class PhysicalForm(forms.Form):
	Lung = forms.CharField(max_length=3000,required=False)
	Heart = forms.CharField(max_length=3000,required=False)
	Liver = forms.CharField(max_length=3000,required=False)
	Spleen = forms.CharField(max_length=3000,required=False)
	Hair = forms.CharField(max_length=3000,required=False)
	Skin2 = forms.CharField(max_length=3000,required=False)
	Edema = forms.CharField(max_length=3000,required=False)
	Joint = forms.CharField(max_length=3000,required=False)
	Muscle2 = forms.CharField(max_length=3000,required=False)
	Vasculitis = forms.CharField(max_length=3000,required=False)
	Lymph = forms.CharField(max_length=3000,required=False)
	Nervous2 = forms.CharField(max_length=3000,required=False)
	
class StandardForm(forms.Form):
	optionsRadios1 = forms.CharField(max_length=1)
	optionsRadios2 = forms.CharField(max_length=1)
	optionsRadios3 = forms.CharField(max_length=1)
	optionsRadios4 = forms.CharField(max_length=1)
	optionsRadios5 = forms.CharField(max_length=1)
	optionsRadios6 = forms.CharField(max_length=1)
	optionsRadios7 = forms.CharField(max_length=1)
	optionsRadios8 = forms.CharField(max_length=1)
	optionsRadios9 = forms.CharField(max_length=1)
	optionsRadios10 = forms.CharField(max_length=1)
	optionsRadios11 = forms.CharField(max_length=1)
	optionsRadios12 = forms.CharField(max_length=1)
	optionsRadios13 = forms.CharField(max_length=1)
	optionsRadios14 = forms.CharField(max_length=1)
	optionsRadios15 = forms.CharField(max_length=1)
	optionsRadios16 = forms.CharField(max_length=1)
	optionsRadios17 = forms.CharField(max_length=1)
	
	
class FollowForm(forms.Form):
	ssddi = forms.CharField(max_length=300)
	ssdi = forms.CharField(max_length=300)
	essdai = forms.CharField(max_length=300)
	PCS = forms.CharField(max_length=300)
	MCS = forms.CharField(max_length=300)
	esspri = forms.CharField(max_length=300)
	pcm = forms.CharField(max_length=300,required=False)
	tongue = forms.CharField(max_length=300,required=False)
	other = forms.CharField(max_length=300,required=False)
	inputdate=forms.DateField()

	
	
class LabfindingsForm(forms.Form):
	inputdate=forms.DateField(required=False)
	patient_id = forms.CharField()
	ANA = forms.CharField(max_length=550,required=False)
	anti_ENA_Ab = forms.CharField(max_length=550,required=False)
	SSA = forms.CharField(max_length=550,required=False)
	SSB = forms.CharField(max_length=550,required=False)
	RNP = forms.CharField(max_length=550,required=False)
	Jo = forms.CharField(max_length=550,required=False)
	Scl = forms.CharField(max_length=550,required=False)
	dsDNA = forms.CharField(max_length=550,required=False)
	MPO = forms.CharField(max_length=550,required=False)
	PR3 = forms.CharField(max_length=550,required=False)
	anti_CCP_Ab = forms.CharField(max_length=550,required=False)
	anticardiolipin = forms.CharField(max_length=550,required=False)
	RF = forms.CharField(max_length=550,required=False)
	serum = forms.CharField(max_length=550,required=False)
	IgM = forms.CharField(max_length=550,required=False)
	IgA = forms.CharField(max_length=550,required=False)
	C3 = forms.CharField(max_length=550,required=False)
	C4 = forms.CharField(max_length=550,required=False)
	CH50 = forms.CharField(max_length=550,required=False)
	SS = forms.CharField(max_length=550,required=False)
	hormone = forms.CharField(max_length=550,required=False)
	CTX =forms.CharField(max_length=550,required=False)
	MTX =forms.CharField(max_length=550,required=False)
	Aza =forms.CharField(max_length=550,required=False)
	CQ =forms.CharField(max_length=550,required=False)
	reaction =forms.CharField(max_length=550,required=False)
	other =forms.CharField(max_length=550,required=False)
	X_ray =forms.CharField(max_length=550,required=False)
	CTScan =forms.CharField(max_length=550,required=False)
	ECG  =forms.CharField(max_length=550,required=False)
	UCG  =forms.CharField(max_length=550,required=False)
	Pulmonary =forms.CharField(max_length=550,required=False)
	EEG =forms.CharField(max_length=550,required=False)
	ultrasonagraphy  =forms.CharField(max_length=550,required=False)
	EMG =forms.CharField(max_length=550,required=False)
	Labial =forms.CharField(max_length=550,required=False)
	pathologyNO1 =forms.CharField(max_length=550,required=False)
	date1 =forms.CharField(max_length=550,required=False)
	Renal =forms.CharField(max_length=550,required=False)
	pathologyNO2 =forms.CharField(max_length=550,required=False)
	date2 =forms.CharField(max_length=550,required=False)
	Bone =forms.CharField(max_length=550,required=False)
	pathologyNO3 =forms.CharField(max_length=550,required=False)
	date3 =forms.CharField(max_length=550,required=False)
	
	
class EssdaiForm(forms.Form):
	RadioGroup1 = forms.CharField(max_length=3)
	RadioGroup2 = forms.CharField(max_length=3)
	RadioGroup3 = forms.CharField(max_length=3)
	RadioGroup4 = forms.CharField(max_length=3)
	RadioGroup5 = forms.CharField(max_length=3)
	RadioGroup6 = forms.CharField(max_length=3)
	RadioGroup7 = forms.CharField(max_length=3)
	RadioGroup8 = forms.CharField(max_length=3)
	RadioGroup9 = forms.CharField(max_length=3)
	RadioGroup10 = forms.CharField(max_length=3)
	RadioGroup11 = forms.CharField(max_length=3)
	RadioGroup12 = forms.CharField(max_length=3)
	
class SsdiForm(forms.Form):
	 RadioGroup1 = forms.CharField(max_length=1)
	 RadioGroup2 = forms.CharField(max_length=1)
	 RadioGroup3 = forms.CharField(max_length=1)
	 RadioGroup4 = forms.CharField(max_length=1)
	 RadioGroup5 = forms.CharField(max_length=1)
	 RadioGroup6 = forms.CharField(max_length=1)
	 RadioGroup7 = forms.CharField(max_length=1)
	 RadioGroup8 = forms.CharField(max_length=1)
	 RadioGroup9 = forms.CharField(max_length=1)
	 text_r = forms.CharField(max_length=200,required=False)
	 text_l = forms.CharField(max_length=200,required=False)
	 text_12 = forms.CharField(max_length=200,required=False)
	 RadioGroup13 = forms.CharField(max_length=1)
	 RadioGroup14 = forms.CharField(max_length=1)
	 RadioGroup15 = forms.CharField(max_length=1)
	 RadioGroup16 = forms.CharField(max_length=1)
	 RadioGroup17 = forms.CharField(max_length=1)
	 RadioGroup18 = forms.CharField(max_length=1)
	 RadioGroup19 = forms.CharField(max_length=1)
	 RadioGroup20 = forms.CharField(max_length=1)
	 RadioGroup21 = forms.CharField(max_length=1)
	 RadioGroup22 = forms.CharField(max_length=1)
	 RadioGroup23 = forms.CharField(max_length=1)
	 RadioGroup24 = forms.CharField(max_length=1)
	 RadioGroup25 = forms.CharField(max_length=1)
	 RadioGroup26 = forms.CharField(max_length=1)
	 RadioGroup27 = forms.CharField(max_length=1)
	 RadioGroup28 = forms.CharField(max_length=1)
	 RadioGroup29 = forms.CharField(max_length=1)
	 RadioGroup30 = forms.CharField(max_length=1)
	 RadioGroup31 = forms.CharField(max_length=1)
	 RadioGroup32 = forms.CharField(max_length=1)
	 RadioGroup33 = forms.CharField(max_length=1)
	 RadioGroup34 = forms.CharField(max_length=1)
	 RadioGroup35 = forms.CharField(max_length=1)
	 RadioGroup36 = forms.CharField(max_length=1)
	 RadioGroup37 = forms.CharField(max_length=1)
	 RadioGroup38 = forms.CharField(max_length=1)
	 RadioGroup39 = forms.CharField(max_length=1)
	 RadioGroup40 = forms.CharField(max_length=1)
	 dd = forms.CharField(max_length=200,required=False) #滴度
	 zcfw_dd = forms.CharField(max_length=200,required=False) #正常范围
	 t4 = forms.CharField(max_length=200,required=False)
	 zcfw_t4 = forms.CharField(max_length=200,required=False)
	 tsh = forms.CharField(max_length=200,required=False)
	 zcfw_tsh = forms.CharField(max_length=200,required=False)
	 

class SsddiForm(forms.Form):
    checkbox1 = forms.CharField(max_length=3,required=False)
    checkbox2 = forms.CharField(max_length=3,required=False)
    checkbox3 = forms.CharField(max_length=3,required=False)
    checkbox4 = forms.CharField(max_length=3,required=False)
    checkbox5 = forms.CharField(max_length=3,required=False)
    checkbox6 = forms.CharField(max_length=3,required=False)
    checkbox7 = forms.CharField(max_length=3,required=False)
    checkbox8 = forms.CharField(max_length=3,required=False)
    checkbox9 = forms.CharField(max_length=3,required=False)
    checkbox10 = forms.CharField(max_length=3,required=False)
    checkbox11 = forms.CharField(max_length=3,required=False)
    checkbox12 = forms.CharField(max_length=3,required=False)
    checkbox13 = forms.CharField(max_length=3,required=False)
    checkbox14 = forms.CharField(max_length=3,required=False)
    checkbox15 = forms.CharField(max_length=3,required=False)

class Login_Form(forms.Form):
	username = forms.CharField(max_length=20)
	password = forms.CharField(max_length=20)
	
class password_change_Form(forms.Form):
	oldpassword = forms.CharField(max_length=30) 
	newpassword = forms.CharField(max_length=30) 
	newpassword1 = forms.CharField(max_length=30) 

